package com.cloud.test02;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 请求的转发跳转
 * 可以让请求从服务端跳转到客户端（或指定servlet）
 * 服务端行为（操作由服务器控制）
 *(被跳转)
 * @author DELL
 */

@WebServlet(value = {"/RTest04", "/rtest04"})
public class RequestTest04 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获取客户端传递的参数
        // * 获取指定名称的参数，返回字符串 ****
        String uName = req.getParameter("userName");
        String uPassword = req.getParameter("userPassword");
        System.out.println("Servlet04 " + "uName = " + uName + " uPassword = " + uPassword);
    }
}
